<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateTableMemberScoreLog extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('member_score_log', function (Blueprint $table) {
            $table->id();
            $table->integer('member_id')->comment('会员ID');
            $table->enum('action', ['increase', 'reduce'])->comment('动作 increase:增加 reduce:减少');
            $table->integer('score')->comment('积分');
            $table->integer('current_score')->comment('当前积分');
            $table->longText('remark')->comment('说明');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('member_score_log');
    }
}
